Skip to content

Expand C++ integration testing for ECC#256

Open
kenneth-tucker wants to merge 1 commit intomainfrom
user/v-ktucker/222-more-testing-ecc
Open

Expand C++ integration testing for ECC#256
kenneth-tucker wants to merge 1 commit intomainfrom
user/v-ktucker/222-more-testing-ecc

Conversation

@kenneth-tucker
Copy link
Copy Markdown
Contributor

No description provided.

@kenneth-tucker kenneth-tucker self-assigned this Mar 11, 2026
Copilot AI review requested due to automatic review settings March 11, 2026 19:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands ECC-related integration testing in the C++ test suite and adjusts the Rust ECC pre-hashed ECDSA signing implementation to accept oversized output buffers (matching the C API’s “buffer is a capacity” contract).

Changes:

  • Add extensive new C++ ECC sign/verify test coverage (binary payloads, buffer sizing sweeps, algorithm/curve matrices, and argument-validation scenarios).
  • Expand C++ ECC key attestation (key report) tests with additional boundary and contract checks.
  • Update Rust HsmEccSignAlgo::sign() to treat signature buffers as “at least required size” (reject only when too small).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
api/tests/cpp/algo/ecc/sign_verify_tests.cpp Large expansion of ECC sign/verify single-shot + streaming coverage and API contract tests.
api/tests/cpp/algo/ecc/keyreport_tests.cpp Adds key report buffer/argument contract tests and additional handle-class coverage.
api/tests/cpp/algo/ecc/keygen_tests.cpp Reorganizes/expands ECC keygen lifecycle tests and property-validation coverage.
api/lib/src/algo/ecc/sign.rs Fixes ECC sign output-buffer sizing check to allow oversized buffers.

Copilot AI review requested due to automatic review settings March 13, 2026 16:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.

#include "handle/part_handle.hpp"
#include "handle/part_list_handle.hpp"
#include "handle/session_handle.hpp"
#include "../aes/helpers.hpp"
Copilot AI review requested due to automatic review settings March 13, 2026 19:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.


[dependencies]
azihsm_api.workspace = true
azihsm_crypto.workspace = true
Copilot AI review requested due to automatic review settings March 17, 2026 17:19
@kenneth-tucker kenneth-tucker force-pushed the user/v-ktucker/222-more-testing-ecc branch from c4adfd5 to 06c79e3 Compare March 17, 2026 17:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

@kenneth-tucker kenneth-tucker force-pushed the user/v-ktucker/222-more-testing-ecc branch from 071d2c5 to 18408cd Compare March 17, 2026 18:01
@kenneth-tucker kenneth-tucker marked this pull request as ready for review March 17, 2026 18:01
Copilot AI review requested due to automatic review settings March 17, 2026 18:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (2)

api/native/src/algo/rsa/key.rs:1

  • validate_rsa_aes_wrap_params(params) is now called both inside the TryFrom<&AzihsmAlgo> implementation and again in rsa_unwrap_key / rsa_unwrap_key_pair. This duplicates work and increases the chance of the validations diverging over time. Consider removing the second validation in the unwrap functions and relying on the TryFrom path as the single validation gate.
// Copyright (c) Microsoft Corporation.

api/native/src/algo/rsa/key.rs:1

  • validate_rsa_aes_wrap_params(params) is now called both inside the TryFrom<&AzihsmAlgo> implementation and again in rsa_unwrap_key / rsa_unwrap_key_pair. This duplicates work and increases the chance of the validations diverging over time. Consider removing the second validation in the unwrap functions and relying on the TryFrom path as the single validation gate.
// Copyright (c) Microsoft Corporation.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 4 comments.

Copilot AI review requested due to automatic review settings March 18, 2026 21:27
@kenneth-tucker kenneth-tucker force-pushed the user/v-ktucker/222-more-testing-ecc branch from de11200 to 00de38f Compare March 18, 2026 21:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.

@mhatrevi mhatrevi requested a review from rajesh-gali March 18, 2026 23:56
Copilot AI review requested due to automatic review settings March 19, 2026 00:44
@kenneth-tucker kenneth-tucker force-pushed the user/v-ktucker/222-more-testing-ecc branch from a416baa to a1a5b87 Compare March 19, 2026 00:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

api/native/doc/chapter_09_data_structs.md:558

  • The OAEP docs here refer to the field name mgf_id, but the rest of the SDK/test code uses mgf1_hash_algo_id for azihsm_algo_rsa_pkcs_oaep_params (and the table below labels it as mgf1). Please align this section’s field naming with the actual C struct field name to avoid confusion for API consumers.
**Current SDK limitation:** `hash_algo_id` and `mgf_id` must use the same hash function.
Passing mixed OAEP hash/MGF1 combinations returns `AZIHSM_STATUS_INVALID_ARGUMENT`.

```cpp
struct azihsm_algo_rsa_pkcs_oaep_params {
    azihsm_algo_id hash_algo_id;
    azihsm_mgf1_id mgf_id;
    const azihsm_buffer *label;

oaep_params.mgf1_hash_algo_id,
oaep_params.label,
)?;

@@ -36,6 +36,8 @@ impl<'a> TryFrom<&'a AzihsmAlgo> for &'a AzihsmAlgoRsaAesKeyWrapParams {
// Validate OAEP parameters pointer
validate_ptr(params.oaep_params)?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant call as deref_ptr in validate_rsa_aes_wrap_params does the check

Copilot AI review requested due to automatic review settings March 19, 2026 05:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.


You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +357 to +361
if (std::string(ex.what()).find("Error: -8") != std::string::npos)
{
skipped_due_to_session_capacity = true;
return;
}
Comment on lines +936 to +940
{
if (std::string(ex.what()).find("Error: -8") != std::string::npos)
{
skipped_due_to_session_capacity = true;
return;
Comment on lines +1463 to +1467
catch (const std::exception &ex)
{
if (std::string(ex.what()).find("Error: -8") != std::string::npos)
{
skipped_due_to_session_capacity = true;
@mhatrevi mhatrevi force-pushed the user/v-ktucker/222-more-testing-ecc branch from aa020b3 to 1ffe694 Compare March 24, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants